import request from '@/config/axios'

export interface DrawingComponentRemarkVO {
  id: number
  dictComponentStatus: boolean
  productId: number
  productType: string
  productRemark: string
  componentId: number
  componentName: string
  type: string
  proportion: string
}

// 查询产品-部件占比列表
export const getDrawingComponentRemarkPage = async (params) => {
  return await request.get({ url: `/config/drawing-component-remark/page`, params })
}

// 查询产品-部件占比详情
export const getDrawingComponentRemark = async (id: number) => {
  return await request.get({ url: `/config/drawing-component-remark/get?id=` + id })
}

// 新增产品-部件占比
export const createDrawingComponentRemark = async (data) => {
  return await request.post({ url: `/config/drawing-component-remark/create`, data })
}

// 修改产品-部件占比
export const updateDrawingComponentRemark = async (data) => {
  return await request.put({ url: `/config/drawing-component-remark/update`, data })
}

// 删除产品-部件占比
export const deleteDrawingComponentRemark = async (id: number) => {
  return await request.delete({ url: `/config/drawing-component-remark/delete?id=` + id })
}

// 导出产品-部件占比 Excel
export const exportDrawingComponentRemark = async (params) => {
  return await request.download({ url: `/config/drawing-component-remark/export-excel`, params })
}

// 编辑时查询详情
export const getDrawingComponentRemarkUnit = async (params) => {
  return await request.get({ url: `/config/drawing-component-remark/get/component`, params })
}

// 新增 改变产品类型时查询部件-部件占比列表
export const getDrawingComponentRemarkUnitCreate = async (id: number) => {
  return await request.get({ url: `/config/drawing-component/get/component?id=` + id })
}

// 获取产品类型
export const getDrawingComponentProduct = async (keyword) => {
  return await request.get({ url: `/config/drawing-component/list-all-simple?keyword=${keyword}` })
}